<template>
  <a-card :bordered="false">
    <detail-list title="导师信息" :col="2">
      <detail-list-item term="教师类型">{{ teacherInfo.jzglbmc }}&emsp;</detail-list-item>
      <detail-list-item term="职工编号">{{ teacherInfo.gh }}&emsp;</detail-list-item>
      <detail-list-item term="姓名">{{ teacherInfo.xm }}&emsp;</detail-list-item>
      <detail-list-item term="教师状态">{{ teacherInfo.dqztmc }}&emsp;</detail-list-item>
      <detail-list-item term="姓名拼音">{{ teacherInfo.xmpy }}&emsp;</detail-list-item>
      <detail-list-item term="英文姓名">{{ teacherInfo.ywxm }}&emsp;</detail-list-item>
      <detail-list-item term="曾用名">{{ teacherInfo.cym }}&emsp;</detail-list-item>
      <detail-list-item term="性别">{{ teacherInfo.xbmc }}&emsp;</detail-list-item>
      <detail-list-item term="身份证类型">{{ teacherInfo.sfzjlxmc }}&emsp;</detail-list-item>
      <detail-list-item term="身份证件号">{{ teacherInfo.sfzjh }}&emsp;</detail-list-item>
      <detail-list-item term="证件有效期">{{ teacherInfo.sfzjyxq && teacherInfo.sfzjyxq.format('YYYY-MM-DD') }}&emsp;</detail-list-item>
      <detail-list-item term="出生日期">{{ teacherInfo.csrq && teacherInfo.csrq.format('YYYY-MM-DD') }}&emsp;</detail-list-item>
      <detail-list-item term="国籍">{{ teacherInfo.gjmc }}&emsp;</detail-list-item>
      <detail-list-item term="民族">{{ teacherInfo.mzmc }}&emsp;</detail-list-item>
      <detail-list-item term="政治面貌">{{ teacherInfo.zzmmmc }}&emsp;</detail-list-item>
      <detail-list-item term="宗教信仰">{{ teacherInfo.xyzjmc }}&emsp;</detail-list-item>
      <detail-list-item term="港澳台侨">{{ teacherInfo.gatqwmc }}&emsp;</detail-list-item>
      <detail-list-item term="婚姻状况">{{ teacherInfo.hyzkmc }}&emsp;</detail-list-item>
      <detail-list-item term="健康状况">{{ teacherInfo.jkzkmc }}&emsp;</detail-list-item>
      <detail-list-item term="血型">{{ teacherInfo.xxmc }}&emsp;</detail-list-item>
      <detail-list-item term="籍贯">{{ teacherInfo.jgsdmc }}&emsp;{{ teacherInfo.jgcdmc }}&emsp;{{ teacherInfo.jgxqdmc }}</detail-list-item>
      <detail-list-item term="出生地">{{ teacherInfo.csdsmc }}&emsp;{{ teacherInfo.csdcmc }}&emsp;{{ teacherInfo.csdqxmc }}</detail-list-item>
      <detail-list-item term="户口类型">{{ teacherInfo.hklbmc }}&emsp;</detail-list-item>
      <detail-list-item term="户口所在地">{{ teacherInfo.hkszd }}&emsp;</detail-list-item>
      <detail-list-item term="家庭地址">{{ teacherInfo.jtzz }}&emsp;</detail-list-item>
      <detail-list-item term="文化程度">{{ teacherInfo.whcdmc }}&emsp;</detail-list-item>
      <detail-list-item term="参加工作年月">{{ teacherInfo.cjgzny && teacherInfo.cjgzny.format('YYYY-MM') }}&emsp;</detail-list-item>
      <detail-list-item term="来校日期">{{ teacherInfo.lxrq && teacherInfo.lxrq.format('YYYY-MM') }}&emsp;</detail-list-item>
      <detail-list-item term="起薪日期">{{ teacherInfo.qxrq && teacherInfo.qxrq.format('YYYY-MM') }}&emsp;</detail-list-item>
      <detail-list-item term="从教年月">{{ teacherInfo.cjny && teacherInfo.cjny.format('YYYY-MM') }}&emsp;</detail-list-item>
      <detail-list-item term="任课状况">{{ teacherInfo.rkzkmc }}&emsp;</detail-list-item>
      <detail-list-item term="最后学历">{{ teacherInfo.zgxlmc }}&emsp;</detail-list-item>
      <detail-list-item term="最后学位">{{ teacherInfo.zhxwmc }}&emsp;</detail-list-item>
      <detail-list-item term="毕业院校或机构">{{ teacherInfo.byxxmc }}&emsp;</detail-list-item>
      <detail-list-item term="毕业年月">{{ teacherInfo.byny && teacherInfo.byny.format('YYYY-MM') }}&emsp;</detail-list-item>
      <detail-list-item term="通讯地址">{{ teacherInfo.txdz }}&emsp;</detail-list-item>
      <detail-list-item term="所属院系">{{ teacherInfo.ssyxmc }}&emsp;</detail-list-item>
      <detail-list-item term="所属专业">{{ teacherInfo.zdzymc }}&emsp;</detail-list-item>
      <detail-list-item term="定职时间">{{ teacherInfo.dzsj && teacherInfo.dzsj.format('YYYY-MM') }}&emsp;</detail-list-item>
      <detail-list-item term="职称">{{ teacherInfo.zcmc }}&emsp;</detail-list-item>
      <detail-list-item term="手机号码">{{ teacherInfo.lxdh }}&emsp;</detail-list-item>
      <detail-list-item term="住宅电话">{{ teacherInfo.zzdh }}&emsp;</detail-list-item>
      <detail-list-item term="办公电话">{{ teacherInfo.bgdh }}&emsp;</detail-list-item>
      <detail-list-item term="邮政编码">{{ teacherInfo.yzbm }}&emsp;</detail-list-item>
      <detail-list-item term="电子邮箱">{{ teacherInfo.dzxx }}&emsp;</detail-list-item>
      <detail-list-item term="主页地址">{{ teacherInfo.zydz }}&emsp;</detail-list-item>
      <detail-list-item term="导师资助科研经费账号">{{ teacherInfo.dszzkyjfzh }}&emsp;</detail-list-item>
      <detail-list-item term="个人简介">{{ teacherInfo.dsjj }}&emsp;</detail-list-item>
      <detail-list-item term="审核结果">{{ teacherInfo.dsshztmc }}&emsp;</detail-list-item>
      <detail-list-item term="审核备注">{{ teacherInfo.shsm }}&emsp;</detail-list-item>
    </detail-list>
    <a-form :form="form" style="margin-top: 50px">
      <a-row>
        <a-col :md="8" :sm="24">
          <a-form-item
            label="审核结果"
            :labelCol="{span: 7,offset: 1}"
            :wrapperCol="{span: 15, offset: 1}"
          >
            <a-select v-decorator="['shzt',
              {
                rules: [{ required: true, message: '请选择审核结果!' }],
              }]">
              <a-select-option value="02">通过</a-select-option>
              <a-select-option value="03">不通过</a-select-option>
              <!-- <a-select-option v-for="i in TYPE0318" :key="i.id" :value="i.code">{{ i.name }}</a-select-option> -->
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="16" :sm="24">
          <a-form-item
            label="审核备注"
            :labelCol="{span: 7,offset: 1}"
            :wrapperCol="{span: 15, offset: 1}"
          >
            <a-input type="textarea" v-decorator="['shsm']" :autosize="{ minRows: 4, maxRows: 6 }"/>
          </a-form-item>
        </a-col>
      </a-row>
    </a-form>
    <div class="ant-pro-footer-toolbar">
      <a-button style="float: right;margin: 10px;" @click="back">返回</a-button>
      <a-button style="float: right;margin-top: 10px;" @click="submit" :loading="loadingBtn" type="primary">提交审核</a-button>
    </div>
  </a-card>
</template>

<script>
import DetailList from '~/tool/DetailList'
// import { mapState } from 'vuex'
const DetailListItem = DetailList.Item

export default {
  data () {
    return {
      teacherInfo: {},
      loadingBtn: false
    }
  },
  components: {
    DetailList,
    DetailListItem
  },
  // computed: {
  //   ...mapState({
  //     TYPE0318: state => state.app['TYPE0318']
  //   })
  // },
  beforeCreate () {
    this.form = this.$form.createForm(this)
  },
  created () {
    // this.$store.dispatch('app/setDictionary', 'TYPE0318')
    this.$api.cultivate.teacherDetail(this.$route.params.bh).then(res => {
      this.teacherInfo = res.data
      //this.form.setFieldsValue({shzt: res.data.shzt, shsm: res.data.shsm})
    })
  },
  methods: {
    submit () {
      this.form.validateFields((err, values) => {
        if (err) {
          return
        }
        this.loadingBtn = true
        this.$api.cultivate.teacherCheck(Object.assign(values, {ghs: this.$route.params.bh})).then(res => {
          this.$message.success(res.data)
          this.$router.back()
        }).finally(() => {
          this.loadingBtn = false
        })
      })
    },
    back () {
      this.$router.back()
    }
  }
}
</script>

<style>

</style>
